<?php

class AdminController extends Zend_Controller_Action
{
   
    private  $auth;

    public function init()
    {
     $this->auth=  Zend_Auth::getInstance();      
      if(!$this->auth->hasIdentity()){
             $this->_redirect('index');
      }elseif($this->auth->getStorage()->read()->ADMIN =="Y"){
          $_SESSION['role']='A';
      }else{
          $this->_redirect('/resident');
      }
    
    }

    public function indexAction()
    {
        $this->view->title="Admin -  Welcome to Rosemoore Lake";
    }


}

